package com.ftg.learn.day09.exam02;

import lombok.Data;

/**
 * 狗
 *
 * @author kangjx
 * @version 1.0
 * @date 2023/7/28 上午8:12
 */
@Data
public class Dog implements Comparable<Dog> {

    //成变变量  实例变量

    //类变量 static

    // 全局 局部

    private int age;

    private  String color;

    private String name;
    private static final int PERSON_NO = 28;

    //单一原则
    public void setColor(String color){
        this.color = color;
    }

    public String getColor(){
        return this.color;
    }

    public String getInfo(){
        return this.getColor()+this.getName();
    }

    public static void main(String[] args) {
        Dog d1 = new Dog();
        d1.setColor("白色");

        System.out.println(d1.getColor());

    }

    @Override
    public int compareTo(Dog o) {
        return -(this.age - o.age);
    }
    //关联 1- 1 1 - m m- n


}
